﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="PromotionManagement.aspx.cs" Inherits="EWDTAssignment.PromotionManagement" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" DataSourceID="PromotionDS" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True" />
            <asp:BoundField DataField="StartTime" HeaderText="StartTime" />
            <asp:BoundField DataField="EndTime" HeaderText="EndTime" />
            <asp:BoundField DataField="DiscountRate" HeaderText="DiscountRate" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="PromotionDS" runat="server" 
        DeleteMethod="DeletePromotion" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="RetrievePromotion" TypeName="EWDTAssignment.App_Code.DBManager" 
        UpdateMethod="UpdatePromotion">
        <DeleteParameters>
            <asp:Parameter Name="startTime" Type="DateTime" />
            <asp:Parameter Name="endTime" Type="DateTime" />
            <asp:Parameter Name="productID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="discountRate" Type="Double" />
            <asp:Parameter Name="startTime" Type="DateTime" />
            <asp:Parameter Name="endTime" Type="DateTime" />
            <asp:Parameter Name="productID" Type="Int32" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <asp:Button ID="CreatePromotionBtn" runat="server" 
        PostBackUrl="~/setPromotion.aspx" Text="Create Promotion" />
    <br />
</asp:Content>
